home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesS-T.lzh / TearawayThomas.lha / TearawayThomasHD / Install next >
Text File  |  2000-09-03  |  3KB  |  168 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of readme file
  4. (set #cleanup "")        ;files to delete after install
  5. (set #last-file "Disk.1")    ;last file the imager should create
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; Checks if given program is reachable via the path
  10. ; if not abort install
  11. ; IN:  #program - to check
  12. ; OUT: -
  13.  
  14. (procedure P_chkrun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  19.   )
  20. )
  21.  
  22. ;****************************
  23.  
  24. (if
  25.   (exists #readme-file)
  26.   (if 
  27.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  28.     ("")
  29.     (run ("SYS:Utilities/More %s" #readme-file))
  30.   )
  31. )
  32.  
  33. (set #program "WHDLoad")
  34. (P_chkrun)
  35.  
  36. (set #program "RawDIC")
  37. (P_chkrun)
  38.  
  39. (if
  40.   (= @user-level 2)
  41.   (
  42.     (set #CI_drive
  43.       (askchoice
  44.     (prompt "Select source drive for diskimages")
  45.     (default 0)
  46.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  47.     (help @askchoice-help)
  48.       )
  49.     )
  50.     (select #CI_drive
  51.       (set #CI_drive "DF0:")
  52.       (set #CI_drive "DF1:")
  53.       (set #CI_drive "DF2:")
  54.       (set #CI_drive "DF3:")
  55.     )
  56.   )
  57.   (set #CI_drive "DF0:")
  58. )
  59.  
  60. (set @default-dest
  61.   (askdir
  62.     (prompt ("Where should \"%s\" be installed ?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
  63.     (help @askdir-help)
  64.     (default @default-dest)
  65.     (disk)
  66.   )
  67. )
  68. (set #dest (tackon @default-dest @app-name))
  69. (if
  70.   (exists #dest)
  71.   (
  72.     (set #choice
  73.       (askbool
  74.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
  75.         (default 1)
  76.         (choices "Delete" "Skip")
  77.         (help @askbool-help)
  78.       )
  79.     )
  80.     (if
  81.       (= #choice 1)
  82.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  83.     )
  84.   )
  85. )
  86. (makedir #dest
  87.   (help @makedir-help)
  88.   (infos)
  89. )
  90.  
  91. ;----------------------------
  92.  
  93. (if
  94.   (exists ("%s.newicon" @app-name))
  95.   (set #icon
  96.     (askchoice
  97.       (prompt "\nWhich icon would you like to install?\n")
  98.       (default 0)
  99.       (choices "Normal" "NewIcon" "GlowIcon")
  100.       (help @askchoice-help)
  101.     )
  102.   )
  103.   (set #icon 0)
  104. )
  105. (select #icon
  106.   (set #icon ("%s.inf" @app-name))
  107.   (set #icon ("%s.newicon" @app-name))
  108.   (set #icon ("%s.glowicon" @app-name))
  109. )
  110. (copyfiles
  111.   (help @copyfiles-help)
  112.   (source #icon)
  113.   (newname ("%s.info" @app-name))
  114.   (dest #dest)
  115. )
  116. (copyfiles
  117.   (help @copyfiles-help)
  118.   (source ("%s.slave" @app-name ))
  119.   (dest #dest)
  120. )
  121. (if
  122.   (exists #readme-file)
  123.   (copyfiles
  124.     (help @copyfiles-help)
  125.     (source #readme-file)
  126.     (dest #dest)
  127.   )
  128. )
  129. (if
  130.   (exists ("%s.info" #readme-file))
  131.   (copyfiles
  132.     (help @copyfiles-help)
  133.     (source ("%s.info" #readme-file))
  134.     (dest #dest)
  135.   )
  136. )
  137.  
  138. (copyfiles
  139.   (help @copyfiles-help)
  140.   (source ("%s.islave" @app-name))
  141.   (dest #dest)
  142. )
  143. (copyfiles
  144.   (help @copyfiles-help)
  145.   (source ("TTBIN0"))
  146.   (dest #dest)
  147. )
  148. (copyfiles
  149.   (help @copyfiles-help)
  150.   (source ("TTBIN1"))
  151.   (dest #dest)
  152. )
  153.  
  154. (working)
  155. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s\nDelete %s.islave" #dest @app-name #CI_drive @app-name))
  156.  
  157. (if
  158.   (exists (tackon #dest #last-file))
  159.   ("")
  160.   (abort "Diskimaging was not successful!\nRawDIC was unable to create all needed files!")
  161. )
  162.  
  163. ;----------------------------
  164.  
  165. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  166.  
  167. (exit)
  168.